<?php

namespace IDock\Insurance\ACIC\Request;

use Exception;
use IDock\Insurance\ACIC\Response\VehicleTypeQueryResponse;

class VehicleTypeQueryRequest extends AllACICRequest
{
    protected $code = 'Q07';

    protected $response = VehicleTypeQueryResponse::class;

    protected $logTip = '车型库查询';

    private $brandName = '';

    private $familyName = '';

    private $modelCode = '';

    private $year = '';

    private $ipmORLoc = '';

    private $areaCode = '';

    private $start = '';

    private $end = '';

    private $vehicleName = '';

    /**
     * @return array
     * @throws Exception
     */
    public function generate(): array
    {
        $param = [
            'BrandName' => $this->brandName,
            'FamilyName' => $this->familyName,
            'ModelCode' => $this->modelCode,
            'Year' => $this->year,
            'IpmORLoc' => $this->ipmORLoc,
            'AreaCode' => $this->areaCode,
            'VehicleName' => $this->vehicleName,
        ];
        if (!empty($this->start) && !empty($this->end)) {
            $param['Page'] = [
                'Begin' => $this->start,
                'End' => $this->end
            ];
        }
        return $param;
    }

    /**
     * @param string $brandName
     */
    public function setBrandName(string $brandName): void
    {
        $this->brandName = $brandName;
    }

    /**
     * @param string $familyName
     */
    public function setFamilyName(string $familyName): void
    {
        $this->familyName = $familyName;
    }

    /**
     * @param string $modelCode
     */
    public function setModelCode(string $modelCode): void
    {
        $this->modelCode = $modelCode;
    }

    /**
     * @param string $year
     */
    public function setYear(string $year): void
    {
        $this->year = $year;
    }

    /**
     * @param string $ipmORLoc
     */
    public function setIpmORLoc(string $ipmORLoc): void
    {
        $this->ipmORLoc = $ipmORLoc;
    }

    /**
     * @param string $areaCode
     */
    public function setAreaCode(string $areaCode): void
    {
        $this->areaCode = $areaCode;
    }

    /**
     * @param string $start
     */
    public function setStart(string $start): void
    {
        $this->start = $start;
    }

    /**
     * @param string $end
     */
    public function setEnd(string $end): void
    {
        $this->end = $end;
    }


    /**
     * @param string $vehicleName
     */
    public function setVehicleName(string $vehicleName): void
    {
        $this->vehicleName = $vehicleName;
    }


}